package router

import (
	"blog/app/http"
	"github.com/gin-gonic/gin"
)

func (router *Router) album(group *gin.RouterGroup) {
	admin := group.Group("album")
	api := http.ApiGroup.AlbumApi
	{
		admin.POST("/:id", router.handFunc(api.Edit))
		admin.DELETE("/:id", router.handFunc(api.Del))
		admin.POST("/", router.handFunc(api.Create))
		//admin.GET("/:id/images", router.handFunc(api.GetAlbumImages))
		admin.GET("/", router.handFunc(api.Lists))
		admin.POST(":id/upload", router.handFunc(api.Upload))
	}

	images := admin.Group("images")
	{
		images.GET(":aid", router.handFunc(api.GetAlbumImages))
		images.DELETE(":aid/:id", router.handFunc(api.DelAlbumImages))
	}
}
